/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "TYPETAXE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Typetaxe.findAll", query = "SELECT t FROM Typetaxe t"),
    @NamedQuery(name = "Typetaxe.findByIdTypetaxe", query = "SELECT t FROM Typetaxe t WHERE t.idTypetaxe = :idTypetaxe"),
    @NamedQuery(name = "Typetaxe.findByIntituletypetaxe", query = "SELECT t FROM Typetaxe t WHERE t.intituletypetaxe = :intituletypetaxe")})
public class Typetaxe implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_TYPETAXE")
    private Integer idTypetaxe;
    @Basic(optional = false)
    @Column(name = "INTITULETYPETAXE")
    private String intituletypetaxe;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTypetaxe")
    private Collection<Taxe> taxeCollection;

    public Typetaxe() {
    }

    public Typetaxe(Integer idTypetaxe) {
        this.idTypetaxe = idTypetaxe;
    }

    public Typetaxe(Integer idTypetaxe, String intituletypetaxe) {
        this.idTypetaxe = idTypetaxe;
        this.intituletypetaxe = intituletypetaxe;
    }

    public Integer getIdTypetaxe() {
        return idTypetaxe;
    }

    public void setIdTypetaxe(Integer idTypetaxe) {
        this.idTypetaxe = idTypetaxe;
    }

    public String getIntituletypetaxe() {
        return intituletypetaxe;
    }

    public void setIntituletypetaxe(String intituletypetaxe) {
        this.intituletypetaxe = intituletypetaxe;
    }

    @XmlTransient
    public Collection<Taxe> getTaxeCollection() {
        return taxeCollection;
    }

    public void setTaxeCollection(Collection<Taxe> taxeCollection) {
        this.taxeCollection = taxeCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTypetaxe != null ? idTypetaxe.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Typetaxe)) {
            return false;
        }
        Typetaxe other = (Typetaxe) object;
        if ((this.idTypetaxe == null && other.idTypetaxe != null) || (this.idTypetaxe != null && !this.idTypetaxe.equals(other.idTypetaxe))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Typetaxe[ idTypetaxe=" + idTypetaxe + " ]";
    }
    
}
